<template>
	<view>
		<view :class="system.isH5?'bg-1': 'bg'" :style="'background-image: url(' + WEBCONFIG?.tkfl + ');'">
			<uv-navbar @leftClick="$page.back()" title="" bgColor="none"></uv-navbar>
		</view>
		<text class="ml-15 fw-600 fs-18">题库分类</text>
		<view class="px-15">
			<y-list :list="list" :value="value"></y-list>
		</view>
	</view>
</template>

<script setup>
	import system from "@/utils/system";
	import { ref } from "vue"
	import { onLoad } from "@dcloudio/uni-app"
	import { $http, $tool, $page } from '@/utils/index'
	import { useUserStore, useRefs, useWebConfigStore } from "@/stores/index";
	const { WEBCONFIG } = useRefs(useWebConfigStore());
	const list = ref()
	const value = ref([])
	onLoad(() => {
		getList()
	})
	const getList = () => {
		$http.get('Category/getList').then(res => {
			list.value = res.data
			recursion(list.value[0])
		})
	}

	const recursion = (val) => {
		if (val['children']) {
			value.value.push(val['value'])
			recursion(val['children'][0])
		}
	}
</script>

<style scoped>
	.bg {
		height: 416rpx;
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}

	.bg-1 {
		height: 316rpx;
		background-size: cover;
		overflow: hidden;
		background-position: bottom center;
		background-repeat: no-repeat;
		background-size: 100% 129%;
	}
</style>